package com.shensi.api.admin.client.fleet;

import com.shensi.api.admin.client.fallback.fleet.FleetCardClientFallBack;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.device.dto.FleetCardForm;
import com.shensi.api.admin.domian.device.dto.FleetCardQueryForm;
import com.shensi.api.admin.domian.device.dto.FleetCardRechargeForm;
import com.shensi.api.admin.domian.system.SysLogininfor;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.model.LoginUser;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.SecurityUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = FleetCardClientFallBack.class)
@Component
public interface FleetCardClient {

    @PostMapping("/fleet/card")
    public AjaxResult add(@RequestBody FleetCardForm fleetCardForm);

    @PutMapping("/fleet/card/{id}")
    public AjaxResult edit(@PathVariable("id") Long id, @RequestBody FleetCardForm fleetCardForm);

    @PutMapping("/fleet/card/recharge/{id}")
    public AjaxResult recharge(@PathVariable("id") Long id, @RequestBody FleetCardRechargeForm fleetCardRechargeForm);

    @GetMapping("/fleet/card/page")
    public TableDataInfo page(@SpringQueryMap FleetCardQueryForm fleetCardQueryForm) ;

    @PutMapping("/fleet/card/allocationType/{allocationType}/id/{id}")
    public AjaxResult allocationType(@PathVariable("allocationType") Integer allocationType, @PathVariable("id") Long id);

    @PutMapping("/fleet/card/recovery/{id}")
    public AjaxResult recovery(@PathVariable("id") Long id);

    @DeleteMapping("/fleet/card/{ids}")
    public AjaxResult deleted(@PathVariable("ids") List<Long> ids);

    @GetMapping("/fleet/card/{id}")
    public AjaxResult get(@PathVariable("id") Long id);

}
